home *** CD-ROM | disk | FTP | other *** search
- Path: dispatch.news.demon.net!demon!pcf.spectratek.co.uk
- From: Dean Darlison <dean_darlison@spectratek.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: function extruder ?
- Date: Mon, 15 Apr 1996 14:56:56 -0700
- Organization: Spectra-Tek UK Ltd
- Message-ID: <3172C628.70A2@spectratek.co.uk>
- References: <4ktir6$85n@cf01>
- NNTP-Posting-Host: pcf.spectratek.co.uk
- X-NNTP-Posting-Host: pcf.spectratek.co.uk
- X-Mailer: Mozilla 2.0 (Win16; I)
- MIME-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
-
- Charles VIDAL wrote:
- >
- > Does anyone knows about made a programe who extrude C function.
- > I have a source ( a C text file ) , and I want extrude only
- > a function in this file . Does a program make it or Howcan I do it??
- >
- > thank's
- >
- > reply by mail at vidalc@univ-mlv.fr
- >
- > charles / \
- > vidal / ..|\
- > (_\ |_)vidalc@univ-mlv.fr
- > / \@'
- > / \ http://fillmore.univ-mlv.fr/~vidalc
- > _ / ` |
- > \\/ \ | _\
- > \ /_ || \\
- > \____)|_) \_)
-
- Assuming you're on Unix or have access to 'csplit' try variations on the
- following:
-
- csplit -sk sourcefile.c '%function_name%' '%^}%+1'
-
- explanation:
- sourcefile.c is your original C text file
- '%function_name%' is a regexp defining the first location in the
- file to begin splitting from.
- '&^}' is a regexp defining each split point. E.g. the last } of a
- function is found in the first column.
-
- Play with the regexps and examine the output in xx?? files. The command
- will not alter sourcefile.c
-
- After running this, your function should be found in xx00.
-
- Cheers,
- Dean.
- --
- Dean.A.Darlison
- Spectra-Tek UK Ltd
- email: dean_darlison@spectratek.co.uk
- Tel: 01653-695551
-